package com.book.controller;


import com.book.pojo.Channel;
import com.book.service.ChannelService;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.xml.transform.Result;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author fk
 * @since 2023-10-11 22:54:58
 */
@RestController
@RequestMapping("/channel")
public class ChannelController {

    @Autowired
    private ChannelService channelService;

    @GetMapping("/getAll")
    public List<String> getAll(){
        return channelService.getAll();
    }

    @PostMapping("/addChannel")
    public void addChannel(Channel channel){
        channelService.addChannel(channel);
    }

    @PutMapping("/updateChannel")
    public void updateChannel(Channel channel){
        channelService.updateChannel(channel);
    }

    @DeleteMapping("/deleteChannel")
    public void deleteChannel(Integer id){
        channelService.deleteChannel(id);
    }
}
